clear all
close all
clc

load('modeldata_final_100K_b1.mat')
close all
hold off
paramval = mu0_m+log(1-[0 .5]) ;
for i = 1:length(paramval)
    i
   [wstar(:,i),cumcomp(:,i),cumulsum(:,i),meanacceptedw(:,i),expectedw(:,i),proboffer(:,i),probs(:,i),~,~,~,~,cstar(:,i)] = ...
       modelsolve_endosearch(iota_m,b_m,zeta_m,paramval(i),gam_m,mustar_m,sigstar_m,scost_m,lam_m,bet,capT,capT2*10,Nw,Nwlong,cumcomp_m_dat,beliefs_m_dat,proboffer_m_dat,cumsum_m_dat) ;

end




date2 = linspace(1,capT2*10,capT2*10)
h1 = figure(1) ;
plot(date2,wstar(:,1),'-ko',...
   date2,wstar(:,2),'-kx','Linewidth',2)
ylabel('reservation wage','FontSize',24)
xlim([1 21])
h = legend(['$\mu_1$=' num2str(paramval(1))],['$\mu_1$=' num2str(paramval(2)) '' ],'Fontsize',24)
set(h, 'Interpreter', 'latex')
print -depsc2 figures/figure3b.eps

h2 = figure(2) ;
plot(date2,probs(:,1),'-ko',...
   date2,probs(:,2),'-kx','Linewidth',2)
ylabel('probability of searching','FontSize',24)
xlim([1 21])
h = legend(['$\mu_1$=' num2str(paramval(1))],['$\mu_1$=' num2str(paramval(2)) '' ],'Fontsize',24)
set(h, 'Interpreter', 'latex')
print -depsc2 figures/figure3d.eps

